from fastapi import FastAPI

from api import register_routers
from middleware.blog_visit_middleware import blog_visit_middleware
from middleware.exceptions import global_exception_handler

app = FastAPI(title="Blog Service")

# 加载中间件
app.middleware("http")(global_exception_handler)
app.middleware("http")(blog_visit_middleware)

# 挂载API
register_routers(app)